package cn.gz.demo.ui.recylerview_header;



import android.os.Bundle;
import android.view.View;

import androidx.databinding.DataBindingUtil;

import cn.gz.demo.R;
import cn.gz.demo.databinding.RecylerViewHeaderBinding;
import cn.gz.demo.ui.base.BaseActivity;
import cn.gz.demo.utils.IntentUtil;

public class RecylerViewHeaderActivity extends BaseActivity implements View.OnClickListener {
    private RecylerViewHeaderBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this, R.layout.activity_recylerview_header);

        initView();
    }

    private void initView() {
        binding.titleLayout.titleBack.setVisibility(View.GONE);
        binding.titleLayout.titleName.setText("recylerview 添加header");
        binding.btnList.setOnClickListener(this);
        binding.btnGrid.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id) {
            case R.id.btn_list:
                IntentUtil.startActivity(context, RecylerViewListActivity.class);
                break;
            case R.id.btn_grid:
                IntentUtil.startActivity(context, RecylerViewGridActivity.class);
                break;
        }
    }
}
